home *** CD-ROM | disk | FTP | other *** search
- From comp.lang.perl Mon Aug 2 10:18:20 1993
- Newsgroups: comp.lang.perl
- Path: ruuinf!sun4nl!mcsun!uunet!europa.eng.gtefsd.com!wx.gtegsc.com!news.cerf.net!netlabs!lwall
- From: lwall@netlabs.com (Larry Wall)
- Subject: Perl 5 alpha available
- Message-ID: <1993Jul31.094219.23063@netlabs.com>
- Sender: news@netlabs.com
- Nntp-Posting-Host: scalpel.netlabs.com
- Organization: NetLabs, Inc.
- Date: Sat, 31 Jul 1993 09:42:19 GMT
- Lines: 138
-
- I've put a tar of my current Perl 5 directory onto ftp.netlabs.com,
- in pub/outgoing/perl5.0/perl5a1.tar.Z.
-
- Now's your chance to check out all the bugs I said I fixed in Perl 5. :-)
-
- Before you get all twitterpated, this is unsupported "alpha 1" code.
- There is no Configure, only a makefile. It will probably only work on
- a Sun4. The compiler and interpreter are still very much unoptimized
- (though it already runs as fast or faster than Perl 4). It doesn't do
- everything that I want it to yet. It doesn't have the OO stuff yet.
- It doesn't have "my" yet (though it's got the innards for it). It
- doesn't have a debugger.
-
- But it does have references, and you can play with them. All the
- regression tests pass. For your befuddlement, here's the op/ref.t test:
- ----------------------------------------------------
- #!./perl
-
- print "1..24\n";
-
- $bar = "ok 1\n";
- $foo = "ok 2\n";
- {
- local(*foo) = *bar;
- print $foo;
- }
- print $foo;
-
- $baz = "ok 3\n";
- $foo = "ok 4\n";
- {
- local(*foo) = 'baz';
- print $foo;
- }
- print $foo;
-
- $foo = "ok 6\n";
- {
- local(*foo);
- print $foo;
- $foo = "ok 5\n";
- print $foo;
- }
- print $foo;
-
- $baz = "ok 7\n";
- $bar = 'baz';
- $foo = 'bar';
- print $$$foo;
-
- $BAZ = "ok 8\n";
- $BAR = \$BAZ;
- $FOO = \$BAR;
- print $$$FOO;
-
- @ary = (9,10,11,12);
- $ref[0] = \@a;
- $ref[1] = \@b;
- $ref[2] = \@c;
- $ref[3] = \@d;
- for $i (3,1,2,0) {
- push(@{$ref[$i]}, "ok $ary[$i]\n");
- }
- print @a;
- print ${$ref[1]}[0];
- print @{$ref[2]}[0];
- print @{'d'};
-
- $refref = \\$x;
- $x = "ok 13\n";
- print $$$refref;
-
- $ref = [[],2,[3,4,5,]];
- print scalar @$ref == 3 ? "ok 14\n" : "not ok 14\n";
- print $$ref[1] == 2 ? "ok 15\n" : "not ok 15\n";
- print ${$$ref[2]}[2] == 5 ? "ok 16\n" : "not ok 16\n";
- print scalar @{$$ref[0]} == 0 ? "ok 17\n" : "not ok 17\n";
-
- print $ref->[1] == 2 ? "ok 18\n" : "not ok 18\n";
- print $ref->[2]->[0] == 3 ? "ok 19\n" : "not ok 18\n";
-
- $refref = \%whatever;
- $refref->{"key"} = $ref;
- print $refref->{"key"}->[2]->[0] == 3 ? "ok 20\n" : "not ok 20\n";
-
- $spring[5]->[0] = 123;
- $spring[5]->[1] = 456;
- push(@{$spring[5]}, 789);
- print join(':',@{$spring[5]}) eq "123:456:789" ? "ok 21\n" : "not ok 21\n";
-
- @{$spring2{"foo"}} = (1,2,3);
- $spring2{"foo"}->[3] = 4;
- print join(':',@{$spring2{"foo"}}) eq "1:2:3:4" ? "ok 22\n" : "not ok 22\n";
-
- sub mysub { print "ok 23\n" }
- $subref = \&mysub;
- &$subref;
-
- $subrefref = \\&mysub2;
- &$$subrefref("ok 24\n");
- sub mysub2 { print shift }
- --------------------------------------------------------------
- All that gobbledygook works, believe it or not. For fun, run it through
- perl -Dxst.
-
- I smell some new JAPHs coming...
-
- I don't want to get stuck "supporting" this, but if you want to run your
- favorite scripts past it and see which ones toss their salad, you may.
- If you can come up with a decent bug report with a small test case, I'll
- certainly be glad to look at it. I'm not really interested in obscure
- core dumps at the moment. I'm still getting plenty of those on my own.
-
- I'm not yet interested in memory leak reports either.
-
- I can tell you that no program that uses the old autoloading
- mechanism will run, since there is no visibility into the
- symbol table pointers currently. You ought to be able to redefine
- a subroutine while it's running, though. (I haven't tested that in
- several months, however. There oughta be a regression test for that...)
-
- Don't bother trying to diff Perl 4 with Perl 5. Everything is different.
- All names have been regularized. Here's a key, if you're brave and
- want to peek at the sources:
-
- SV scalar value
- AV array value
- HV hash value
- GV glob value
- CV code value
- RV reference value
- PV pointer value
- NV numeric value
- IV integer value
-
- I'm going to be in New Jersey next week, so don't expect quick replies.
-
- Larry
-
-